﻿Public Class mnuPrincipal

    Private m_frmDeposito As frmDeposito
    Public Property frmDeposito() As frmDeposito
        Get
            Return m_frmDeposito
        End Get
        Set(ByVal value As frmDeposito)
            m_frmDeposito = value
        End Set
    End Property

    Private m_frmMarcas As frmMarca
    Public Property frmMarcas() As frmMarca
        Get
            Return m_frmMarcas
        End Get
        Set(ByVal value As frmMarca)
            m_frmMarcas = value
        End Set
    End Property

    Private m_frmRubros As frmRubro
    Public Property frmRubros() As frmRubro
        Get
            Return m_frmRubros
        End Get
        Set(ByVal value As frmRubro)
            m_frmRubros = value
        End Set
    End Property

    Private m_frmImpuestos As frmImpuesto
    Public Property frmImpuestos() As frmImpuesto
        Get
            Return m_frmImpuestos
        End Get
        Set(ByVal value As frmImpuesto)
            m_frmImpuestos = value
        End Set
    End Property

    Private m_frmMercaderiasListado As frmMercaderiaListado
    Public Property frmMercaderiasListado() As frmMercaderiaListado
        Get
            Return m_frmMercaderiasListado
        End Get
        Set(ByVal value As frmMercaderiaListado)
            m_frmMercaderiasListado = value
        End Set
    End Property

    Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click
        Application.Exit()

    End Sub

    Private Sub CustomizeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CustomizeToolStripMenuItem.Click
        If m_frmMarcas Is Nothing Then
            m_frmMarcas = New frmMarca()
            m_frmMarcas.MdiParent = Me
            m_frmMarcas.Show()
        Else

            If Not m_frmMarcas.Visible Then
                m_frmMarcas = New frmMarca()
                m_frmMarcas.MdiParent = Me
                m_frmMarcas.Show()
            Else
                m_frmMarcas.Select()
                m_frmMarcas.Activate()
            End If

        End If
    End Sub

    Private Sub OptionsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles OptionsToolStripMenuItem.Click
        If m_frmRubros Is Nothing Then
            m_frmRubros = New frmRubro()
            m_frmRubros.MdiParent = Me
            m_frmRubros.Show()
        Else

            If Not m_frmRubros.Visible Then
                m_frmRubros = New frmRubro()
                m_frmRubros.MdiParent = Me
                m_frmRubros.Show()
            Else
                m_frmRubros.Select()
                m_frmRubros.Activate()
            End If

        End If
    End Sub

    Private Sub ImpuestosToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ImpuestosToolStripMenuItem.Click
        If m_frmImpuestos Is Nothing Then
            m_frmImpuestos = New frmImpuesto()
            m_frmImpuestos.MdiParent = Me
            m_frmImpuestos.Show()
        Else

            If Not m_frmImpuestos.Visible Then
                m_frmImpuestos = New frmImpuesto()
                m_frmImpuestos.MdiParent = Me
                m_frmImpuestos.Show()
            Else
                m_frmImpuestos.Select()
                m_frmImpuestos.Activate()
            End If

        End If
    End Sub

    Private Sub MercaderiasToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MercaderiasToolStripMenuItem.Click
        If m_frmMercaderiasListado Is Nothing Then
            m_frmMercaderiasListado = New frmMercaderiaListado()
            m_frmMercaderiasListado.MdiParent = Me
            m_frmMercaderiasListado.Show()
        Else

            If Not m_frmMercaderiasListado.Visible Then
                m_frmMercaderiasListado = New frmMercaderiaListado()
                m_frmMercaderiasListado.MdiParent = Me
                m_frmMercaderiasListado.Show()
            Else
                m_frmMercaderiasListado.Select()
                m_frmMercaderiasListado.Activate()
            End If

        End If
    End Sub

    Private Sub DepositosToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DepositosToolStripMenuItem.Click

        If m_frmDeposito Is Nothing Then
            m_frmDeposito = New frmDeposito()
            m_frmDeposito.idDeposito = 1
            m_frmDeposito.MdiParent = Me
            m_frmDeposito.Show()
        Else

            If Not m_frmDeposito.Visible Then
                m_frmDeposito = New frmDeposito()
                m_frmDeposito.MdiParent = Me
                m_frmDeposito.Show()
            Else
                m_frmDeposito.Select()
                m_frmDeposito.Activate()
            End If

        End If

    End Sub

End Class